#ifndef __LOCKGUARD_HPP__
#define __LOCKGUARD_HPP__

class Lockguard
{
public:
    Lockguard(pthread_mutex_t& mutex)
    :_mutex(mutex)
    {
        pthread_mutex_lock(&_mutex);
    }
    ~Lockguard()
    {
        pthread_mutex_unlock(&_mutex);
    }
public:
    pthread_mutex_t& _mutex;             
};

#endif
